#ifndef DROIDMEDIAPLAYER_DECODE_H
#define DROIDMEDIAPLAYER_DECODE_H

#ifdef __cplusplus
extern "C"
{
#endif

    #include <libavformat/avformat.h>

#ifdef __cplusplus
}
#endif
#include "thread.h"
#include "packetqueue.h"

class DecoderBase : public Thread {

public:
    DecoderBase(AVStream* stream);
    ~DecoderBase();

    void enqueue(AVPacket* packet);
    int	packets();
    void stop();

protected:
    PacketQueue*                mQueue;
    AVStream*             		mStream;

    virtual bool                prepare();
    virtual bool                decode(void* ptr);
    virtual bool                process(AVPacket *packet);
    void						handleRun(void* ptr);
};



#endif //DROIDMEDIAPLAYER_DECODE_H
